package com.manbu.live.farmework.redis.starter.keys;

import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author hanWang
 * @Title:
 * @Package
 * @Description:
 * @date 2024/1/2211:28 下午
 */
//@Configurable
@Configuration
@Conditional(RedisKeyLoadMatch.class)
public class UserProviderCacheKeyBuilder extends RedisKeyBuilder{
    private static String USER_INFO_KEY = "userInfo";
    private static String USER_TAG_INFO_KEY = "userTagInfo";
    private static String USER_TAG_LOCK_KEY = "userTagLock";
    private static String USER_PHONE_LIST_KEY = "userPhoneList";
    private static String USER_PHONE_OBJ_KEY = "userPhoneObj";
    private static String USER_LOGIN_TOKEN_KEY = "userLoginToken";
    public String buildUserInfoKey(Long userId) {
        return super.getPrefix() + USER_INFO_KEY +
                super.getSplitItem() + userId;
    }

    public String buildTagLockKey(Long userId) {
        return super.getPrefix() + USER_TAG_LOCK_KEY +
                super.getSplitItem() + userId;
    }
    public String buildUserTagInfoKey(Long userId) {
        return super.getPrefix() + USER_TAG_INFO_KEY +
                super.getSplitItem() + userId;
    }

    public String buildUserPhoneObjKey(String phone) {
        return super.getPrefix() + USER_PHONE_OBJ_KEY +
                super.getSplitItem() + phone;
    }

    public String buildUserPhoneListKey(Long userId) {
        return super.getPrefix() + USER_PHONE_LIST_KEY +
                super.getSplitItem() + userId;
    }

    public String buildUserLoginTokenKey(Long userId) {
        return super.getPrefix() + USER_LOGIN_TOKEN_KEY +
                super.getSplitItem() + userId;
    }
    public String buildUserLoginTokenKey(String token) {
        return super.getPrefix() + USER_LOGIN_TOKEN_KEY +
                super.getSplitItem() + token;
    }
}
